<?php
class ModelNewsExample extends Model{
	public function getList()
	{
		$sql = "SELECT * FROM news;";
		$qry = $this->db->query($sql);
		if(!isset($qry) || $qry == null)
			return null;
	
		$list = array();
		foreach ($qry->rows as $row){
			$league = array(
					'id'	=>	$row['idnews'],
					'name'	=>	$row['title']);
			$list[] = $league;
		}
		return $list;
	}
	
}
?>